<template>
  <div class="tabbaritem" @click="itemclick">
    <div :class="[isActive?'middle':'itemicon']">
      <slot name="itemicon"></slot>
      <div :class="[isActive?'middleText':'itemtext']">
        <slot name="itemtext"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "tabbaritem",
  props: {
    isActive:{
      default: false,
      type:Boolean
    },
    path: String,
    activecolor: {
      default: 'red',
      type: String
    }
  },
  data() {
    return {
      // isActive: true
    }
  },
  computed: {
    // isActive(){
    //   return this.$route.path.indexOf(this.path)
    // },
    // activestyle(){
    //   return this.isActive ? {} : {color: this.activecolor}
    // }
  },
  methods: {
    itemclick() {
      this.$router.replace(this.path)
    }
  }
}
</script>

<style scoped>
.tabbaritem img{
  width: 30px;
  height: 30px;
}
.tabbaritem{
  font-size: 15px;
}
</style>
